home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
clarion
/
cw15
/
examp15.z
/
BLINDS.CLW
< prev
next >
Wrap
Text File
|
1995-09-09
|
5KB
|
157 lines
!==========================================================================!
!Program :BLINDS.EXE
!Author :Dave Harms
!Purpose :An example of how to display images with a flair
!==========================================================================!
BLINDS PROGRAM
INCLUDE('EQUATES.CLW')
MAP
About()
END
Control BYTE
ImageName STRING(255)
LastSpinVal SHORT
Ndx BYTE
Spinner SHORT(1)
SpinVal SHORT
wBlinds WINDOW('Blinds for Windows'),AT(54,21,169,132),SYSTEM,GRAY,DOUBLE,ICON('Winpyr.ico')
MENUBAR
ITEM('E&xit'),STD(STD:Close)
ITEM('&Images'),USE(?Images)
ITEM('&About...'),USE(?About)
ITEM('&Help'),USE(?Help),STD(STD:Help)
END
TOOLBAR,AT(,,169,14)
SPIN(@n3),AT(45,1,6,12),USE(Spinner),IMM,RANGE(1,10)
PROMPT('Open/Close:'),AT(3,2,,),USE(?Prompt1)
END
GROUP,AT(5,4,157,108),USE(?Group1),BOXED
IMAGE('Toplogo.bmp'),AT(7,10,153,100),USE(?ImageFile)
BOX,AT(7,4,153,10),USE(?box1),FILL(0828282H)
BOX,AT(7,14,153,10),USE(?box2),FILL(0828282H)
BOX,AT(7,24,153,10),USE(?box3),FILL(0828282H)
BOX,AT(7,34,153,10),USE(?box4),FILL(0828282H)
BOX,AT(7,44,153,10),USE(?box5),FILL(0828282H)
BOX,AT(7,54,153,10),USE(?box6),FILL(0828282H)
BOX,AT(7,64,153,10),USE(?box7),FILL(0828282H)
BOX,AT(7,74,153,10),USE(?box8),FILL(0828282H)
BOX,AT(7,84,153,10),USE(?box9),FILL(0828282H)
BOX,AT(7,94,153,10),USE(?box10),FILL(0828282H)
END
END
CODE
HELP('CW15Exam')
OPEN(wBlinds)
DO ShowBlinds
ACCEPT
CASE EVENT()
OF EVENT:CloseDown
BREAK
END
CASE FIELD()
OF ?Spinner
CASE EVENT()
OF EVENT:NewSelection
DO ShowBlinds
END
OF ?Images
CASE EVENT()
OF EVENT:Accepted
ImageName = ''
IF NOT FileDialog('Blinds For Windows',ImageName,'BitMaps|*.BMP|Gifs|*.GIF|MetaFiles|*.WMF',0)
POST(EVENT:CloseDown)
ELSE
?ImageFile {PROP:Text} = ImageName
IF Spinner > 1
LOOP UNTIL Spinner = 1
Spinner-=1
DO ShowBlinds
END
END
END
DISPLAY()
END
OF ?About
CASE EVENT()
OF EVENT:Accepted
About()
END
OF ?Help
CASE EVENT()
OF EVENT:Accepted
HELP
END
END
END
CLOSE(wBlinds)
RETURN
ShowBlinds ROUTINE
SpinVal = 11-Spinner
IF SpinVal = LastSpinVal THEN EXIT.
LastSpinVal = SpinVal
LOOP Ndx = 1 to 10
Control = ?Box1-1+Ndx
Control {PROP:YPos} = ((Ndx*10)) + ((10-SpinVal)/2)
Control {PROP:Height} = SpinVal
END
EXIT
About procedure ! An "About box" procedure
!-----------------------------------------------------------------------
! The following CSTRING contains all the text we want to appear in
! the About box - it will be displayed in a text control with a vertical
! scroll bar and the READONLY attribute. That way the user can view all
! the text, but can't change any of it. To force line breaks, we have
! inserted a Carriage Return/Line Feed combination - <13,10>.
!-----------------------------------------------------------------------
AboutText CSTRING('Blinds, CW Style' & |
'<13,10>' & |
'<13,10>by Dave Harms & Ross Santos' & |
'<13,10>' & |
'<13,10>authors of ' & |
'<13,10>"Developing Applications in Clarion for Windows"' & |
'<13,10>(published by Sams)' & |
'<13,10>' & |
'<13,10>Dave Harms' & |
'<13,10>Compuserve: 72341,446' & |
'<13,10>Internet: 72341.446@compuserve.com' & |
'<13,10>' & |
'<13,10>Ross Santos' & |
'<13,10>Compuserve: 71554,637' & |
'<13,10>Internet: 71554.637@compuserve.com' & |
'<13,10>' & |
'<13,10>To use this program: Press and hold down the ' & |
'UP/DOWN Arrows on the Spin Button. ' & |
'The image will appear or hide under the ' & |
'Window Blinds. You can select a different image by ' & |
'pressing the IMAGE menu item. <13,10,13,10>')
wAbout WINDOW('About Blinds'),AT(28,31,202,112),GRAY
TEXT,AT(6,4,193,84),USE(AboutText),VSCROLL,CENTER,READONLY
BUTTON('OK'),AT(84,93,35,14),USE(?OkButton),DEFAULT
END
CODE
OPEN(wAbout) ! Open the window - text will be
ACCEPT ! automatically displayed
CASE FIELD()
OF ?OkButton ! If the user presses the OK button
CASE EVENT() ! then break out of the loop and
OF EVENT:Accepted ! exit the procedure
BREAK
END
END
END